/*----------框架文件加载函数,一般不要修改----------*/
(function(){
	/**
		从框架库加载js文件
		@param {string|Array} path 需要加载的框架JS文件路径,基于
		{@link BASE_JS_LIB_URL}地址
	*/
	function loadFrameWorkJS(path){
		if(typeof path == "string"){
			path = [path];
		}
		for(var i = 0, l = path.length; i < l; i++){
			document.write('<script src="'+BASE_JS_LIB_URL+"/"+path[i]+'?_='+CODE_VERSION+'" charset="utf-8"><\/script>');
		}
	}
	/**
		从框架库加载css文件
		@param {string|Array} path 需要加载的框架CSS文件路径,基于
		{@link BASE_CSS_LIB_URL}地址
	*/
	function loadFrameWorkCSS(path){
		if(typeof path == "string"){
			path = [path];
		}
		for(var i = 0, l = path.length; i < l; i++){
			document.write('<link rel="stylesheet" href="'+BASE_CSS_LIB_URL+"/"+path[i]+'?_='+CODE_VERSION+'">');
		}
	}

	/**
		从系统主题样式文件
	*/
	function loadSystemCSS(){
		document.write('<link rel="stylesheet" href="./resource/themes/'
			+DEFAULT_THEME_SYSTEM+"/theme.css"+'?_='+CODE_VERSION+'">');
	}

	/**
		从系统公用库加载js文件
		@param {string|Array} path 需要加载的框架JS文件路径
	*/
	function loadSystemJS(path){
		if(typeof path == "string"){
			path = [path];
		}
		for(var i = 0, l = path.length; i < l; i++){
			document.write('<script src="'+"./resource/js/"+path[i]+'?_='+CODE_VERSION+'" charset="utf-8"><\/script>');
		}
	}

	//自动加载框架必须的css, 默认使用arctic主题
	loadFrameWorkCSS([
		'base.css',
		'themes/'+DEFAULT_THEME_FRAMEWORK+'/theme.css'
	]);
	loadSystemCSS();

	//自动加载框架必须的js, 默认加载zh文化包
	loadFrameWorkJS([
		'base.js',
		'cultures/globalize.culture.'+DEFAULT_CULTURE+'.js'
	]);

	//自动加载系统公用库
	loadSystemJS([
		"app.js"
	]);
})();